# Copyright (c) 2018 Presto Labs Pte. Ltd.
# Author: inkyu

import re

import requests

from coin.exchange.bithumb.kr_rest.constants import coin_list

for coin in coin_list:
  url = 'https://www.bithumb.com/trade/order/%s' % coin
  data = requests.get(url).content

  pattern = 'unitPrice" value="([0-9]+)"'
  try:
    unit_price = re.search(pattern, data.decode('utf-8')).group(1)
    print("  '%s': ProductInfo.gen3(%s, 4)," % (coin, unit_price))
  except Exception:
    pass
